package com.hziee.graduate.ticket.controller;


import com.hziee.graduate.ticket.dto.R;
import com.hziee.graduate.ticket.service.OrderService;
import com.hziee.graduate.ticket.vo.OrderVO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * (Order)表控制层
 *
 * @author makejava
 * @since 2022-09-06 15:27:04
 */
@RestController
@RequestMapping("order")
public class OrderController {
    @Resource
    private OrderService orderService;

    @GetMapping("getOrderVO/{userId}")
    public R<List<OrderVO>> getOrderVO(@PathVariable Long userId) {
        return orderService.getOrderVO(userId);
    }

    @GetMapping("cancelOrder/{orderId}")
    public R<Object> cancelOrder(@PathVariable String orderId) {
        return orderService.cancelOrder(orderId);
    }

    @GetMapping("payOrder/{orderId}")
    public R<LocalDateTime> payOrder(@PathVariable String orderId) {
        return orderService.payOrder(orderId);
    }

    @GetMapping("checkReChoose/{orderId}")
    public R<Object> checkReChoose(@PathVariable String orderId) {
        return orderService.checkReChoose(orderId);
    }
}

